package com.dyj.goodlife.client;

import com.dtflys.forest.annotation.*;
import com.dyj.common.domain.DataAndExtraVo;
import com.dyj.common.domain.query.BaseQuery;
import com.dyj.common.interceptor.ClientTokenInterceptor;
import com.dyj.goodlife.domain.query.CreatePartnerOrderQuery;
import com.dyj.goodlife.domain.query.QueryPartnerOrderQuery;
import com.dyj.goodlife.domain.query.SaveCommissionQuery;
import com.dyj.goodlife.domain.vo.*;

/**
 * 通用接口->代运营
 */
@BaseRequest(baseURL = "${domain}")
public interface PartnerClient {

    /**
     * 通用接口->代运营->创建合作关系
     * @param body 创建合作关系请求值
     * @return
     */
    @Post(value = "${createPartnerOrder}", interceptor = ClientTokenInterceptor.class)
    DataAndExtraVo<CreatePartnerOrderVo> createPartnerOrder(@JSONBody CreatePartnerOrderQuery body);

    /**
     * 通用接口->代运营->合作列表获取
     * @param body 合作列表获取请求值
     * @return
     */
    @Get(value = "${queryPartnerOrder}", interceptor = ClientTokenInterceptor.class)
    DataAndExtraVo<QueryPartnerOrderVo> queryPartnerOrder(@JSONBody QueryPartnerOrderQuery body);

    /**
     * 通用接口->代运营->合作详情查询
     * @param orderId 订单id
     * @param withoutProductItems 是否不获取商品佣金 选填
     * @return
     */
    @Get(value = "${getPartnerOrder}", interceptor = ClientTokenInterceptor.class)
    DataAndExtraVo<GetPartnerOrderVo> getPartnerOrder(@Var("query") BaseQuery query, @Query("order_id") String orderId, @Query("without_product_items") String withoutProductItems);

    /**
     * 通用接口->代运营->创建/修改佣金
     * @param body 创建/修改佣金请求值
     * @return
     */
    @Post(value = "${saveCommission}", interceptor = ClientTokenInterceptor.class)
    DataAndExtraVo<SaveCommissionVo> saveCommission(@JSONBody SaveCommissionQuery body);

    /**
     * 通用接口->代运营->佣金变更记录列表
     * @param orderId 订单id
     * @param page 页码，起始页为1，默认为1 选填
     * @param size 页面大小，最大50，默认50 选填
     * @return
     */
    @Get(value = "${queryCommissionRecord}", interceptor = ClientTokenInterceptor.class)
    DataAndExtraVo<QueryCommissionRecordVo> queryCommissionRecord(@Var("query") BaseQuery query, @Query("order_id") String orderId, @Query("page") Integer page, @Query("size") Integer size);

    /**
     * 通用接口->代运营->佣金变更记录详情
     * @param orderId 订单id
     * @param recordId 佣金配置记录id
     * @return
     */
    @Get(value = "${getCommissionRecord}", interceptor = ClientTokenInterceptor.class)
    DataAndExtraVo<GetCommissionRecordVo> getCommissionRecord(@Var("query") BaseQuery query, @Query("order_id") String orderId,@Query("record_id") String recordId);

    /**
     * 通用接口->代运营->商品佣金详情
     * @param orderId 订单id
     * @param page 页数，起始页为1，默认1 选填
     * @param size 每页大小，最大50条，默认50 选填
     * @return
     */
    @Get(value = "${queryProductCommission}", interceptor = ClientTokenInterceptor.class)
    DataAndExtraVo<QueryProductCommissionVo> queryProductCommission(@Var("query") BaseQuery query,@Query("order_id") String orderId,@Query("page") Integer page,@Query("size") Integer size);
}
